<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>margin-top:30%</title>
  <style>
    .fa {
      width: 500px;
      height: 500px;
      border: 1px solid black;
    }
    .ch {
      width: 100px;
      height: 100px;
      background: green;
      float: left;
      /* margin-top: 50%; */
      margin-top: 250px;
    }
    .cj {
      width: 100px;
      height: 100px;
      background: green;
      float: right;
      margin-top: 50%;
      /* margin-top: 150px; */
    }
    
  </style>
</head>
<body>
  
  <h3>margin-top 是相对于父元素高度的50%</h3>
  <div class="fa">
    <div class="ch"></div>
    <div class="cj"></div>
  </div>
</body>
</html>